oxenstored: handle unknown operations by returning an error to the client
authorIan Campbell <ian.campbell@citrix.com>
Thu, 15 Dec 2011 16:50:36 +0000 (16:50 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 15 Dec 2011 16:50:36 +0000 (16:50 +0000)
commit25c4397fb24d0253dccfdb8bbe12cf3fd0504103
tree3129933424d631b4afe1267cbc2a6be05e0119f2
parentbe1a130a99285a5ae6937f890ba31be1f7a5a9dc
oxenstored: handle unknown operations by returning an error to the client

Previous an unknown operation would be decoded as a Not_found exception which
would bubble all the way up to the try ... with surrounding the call to
main_loop where it would be logged and ignored.

This would leave the guest hanging waiting for a response to the invalid
request.

Instead introduce a specific "Invalid" operation. Higher level functionality,
such as Process.process_packet, already handles operations which are not
understood with an error reply due to the final wildcard entry in
Process.function_of_type but explicitly handle Invalid this way to make it
clear what is going on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/ocaml/libs/xb/op.ml
tools/ocaml/libs/xb/xb.mli
tools/ocaml/xenstored/logging.ml
tools/ocaml/xenstored/process.ml
tools/ocaml/xenstored/xenstored.ml